From: Dave Rusin [rusin@math.niu.edu] Date: Saturday, October 26, 1996 11:16 PM To: "Mouer, Simon" Subject: Re: Collapse of 9, has anyone heard of t In article <01bbc29f$89510ec0$bb1fb0cc@MOUERS.btna.com> you write: > >Does anyone know of a theory called the collapse of 9? One of my professors >showed me something in which any rational number, when added in a certain >way (the collapse) always equals 9. Has anyone heard of this? CLosest I can think of is "casting out nines": when performing any arithmetic operation on two whole numbers, one can check one's answer in the following way. Process each of the two numbers as shown below, and the putative answer as well; apply the arithmetic operation to the two processed inputs and process the result; you should get the same answer as the processed putative answer. "Processing" a number means replacing it by the sum of its digits, and iterating this step until reaching a number less than 10. If you get 9 replace by 0. For example, let's see if 12345 + 67890 = 24680. Process the first summand: 12345 -> 15 -> 6; do the second (67890 -> 30 -> 3) and the "answer" (24680 -> 20 -> 2). Now add the processed summands and process (6 + 3 = 9 -> 0). Since 0 isn't the same as 2, there is an error in the proposed original summation. Of course this is all tantamount to operating mod 9. dave ============================================================================== Date: Mon, 4 Nov 96 15:03:11 CST From: rusin (Dave Rusin) To: mouers@vaherndon1.btna.com Subject: RE: Collapse of 9, has anyone heard of t As far as I know this behaviour was noticed by the people who set up the decimal system in the first place (medieval Arab traders); it helped check sums in commerce. It's not unrelated to the more sophisticated "checksums" so common nowadays when long strings of digits are used for a variety of purposes: simply attach to each integer one of the symbols 0, 1, ..., 8 (a "check digit") found as I indicated in the previous letter: until check<10 do check=sum of digits of check. The beauty of this particular checksum is that it respects the arithmetic operations: checksum(a+b)=checksum(checksum(a)+checksum(b)) and likewise for "-" and "x". The reason it works is just that checksum(a)=a mod 9: indeed, if you write a out in its decimal expansion , a = a0 + 10*a1 + 100*a2 + ... then the sum of the digits of a. a0+a1+a2+..., differs from a by 9*a1 + 99*a2 + 999*a3 + ..., clearly a multiple of 9. Iterating this until you get a number less than 9 will still give other values all congruent to a mod 9. Then you check that the arithmetic operations may also be reduced mod 9. That is, if a = a' mod 9 and b=b' mod 9, then (a+b) = (a'+b') mod 9. Indeed, if a= a' + 9*a", and b=b'+9*b", then (a+b) = (a'+b') + 9*(a"+b"). Again, subtraction and multiplication are similar. So you can do all your calculations with checksum(a) and checksum(b) instead of a and b, and you'll get the right answer mod 9. You might wonder about division. The problem is that even if a is evenly divisible by b, that is, a = b*c for some integer c, you can't guarantee that checksum(a) / checksum(b) = checksum(c). For one thing, you can easily have problems dividing the checksums: 14 / 7 = 2, but the checksums don't even divide (5/7=?). You can get around that by defining division-mod-9 whenever the denominator is relatively prime to 9 (e.g. "1/7" = 4 since 4*7=1). But you'll still have trouble dividing when the checksum is a multiple of 3. Worse, even if the checksums _do_ divide, you may not get the answer you expect. For example, 183 / 3 = 61, but 3 / 3 <> 7. The problem here comes from the fact that 9 is not prime. Life would be much easier if we worked in octal! You should check out some books on elementary number theory.